<template>
  <div>
    <span>活动车型</span>
    <FilterTable ref="table" :columns="columns" :dataSource="list1" :isColumnFilter="false" :isToperInfo="false" :isSelectColumn="false" :onColumnsChange="columns => (this.columns = columns)">
    </FilterTable>
    <span :style="{ display: 'block', paddingTop: '5px' }">活动车辆</span>
    <FilterTable ref="table" :columns="columns2" :dataSource="list2" :isColumnFilter="false" :isToperInfo="false" :isSelectColumn="false" :onColumnsChange="columns => (this.columns2 = columns)">
    </FilterTable>
  </div>
</template>
<script>
import { getFwhdHdclList, getFwhdHdcxList } from '@/api/repair/business/customer/activity.js';
export default {
  name: 'Actcsope',
  props: ['ACTIVITY_CODE'],
  data() {
    // this.BaseTable = null;
    return {
      columns: this.createTableColumns(),
      columns2: this.createTableColumns2(),
      list1: [],
      list2: []
    };
  },
  created() {
    this.getFwhdHdclList(this.ACTIVITY_CODE);
    this.getFwhdHdcxList(this.ACTIVITY_CODE);
    console.log('传来的CODE', this.ACTIVITY_CODE);
  },
  methods: {
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '操作',
          dataIndex: '',
          sorter: true,
          render: props => {
            return <span>{}</span>;
          }
        },
        {
          title: '活动编号',
          dataIndex: 'ACTIVITY_CODE',
          sorter: true
        },
        {
          title: '车系',
          dataIndex: 'SERIES_NAME',
          sorter: true
        },
        {
          title: '车型代码',
          dataIndex: 'MODEL_CODE',
          sorter: true
        },
        {
          title: '配置',
          dataIndex: 'CONFIG_NAME',
          sorter: true
        },
        {
          title: '生产开始日期',
          dataIndex: 'MANUFACTURE_DATE_BEGIN',
          sorter: true
        },
        {
          title: '生产结束日期',
          dataIndex: 'MANUFACTURE_DATE_END',
          sorter: true
        }
      ];
    },
    createTableColumns2() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 70,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '操作',
          dataIndex: '',
          sorter: true,
          render: props => {
            return <span>{}</span>;
          }
        },
        {
          title: '活动编号',
          dataIndex: 'ACTIVITY_CODE',
          sorter: true
        },
        {
          title: '责任维修站',
          dataIndex: 'DUTY_ENTITY',
          sorter: true
        },
        {
          title: 'VIN',
          dataIndex: 'VIN',
          sorter: true
        }
      ];
    },
    async getFwhdHdclList(row) {
      const res = await getFwhdHdclList(row, {
        creditTimes: 1.0,
        afterlabour: 0,
        zkAmountLabour: 0,
        afterDiscountAmountPart: 0,
        zkAmountPart: 0,
        fag: 'U',
        labourList: '',
        partList: '',
        subjoinList: '',
        modelList: '',
        vehicleList: '',
        order: 'asc',
        limit: 10,
        offset: 0,
        dmsFuncId: 35100010,
        _: 1565681747515
      });
      this.list2 = res.rows;
      console.log('活动车辆table', res);
    },
    async getFwhdHdcxList(row) {
      const res = await getFwhdHdcxList(row, {
        creditTimes: 1.0,
        afterlabour: 0,
        zkAmountLabour: 0,
        afterDiscountAmountPart: 0,
        zkAmountPart: 0,
        fag: 'U',
        labourList: '',
        partList: '',
        subjoinList: '',
        modelList: '',
        vehicleList: '',
        order: 'asc',
        limit: 10,
        offset: 0,
        dmsFuncId: 35100010,
        _: 1565681747515
      });
      this.list1 = res.rows;
      console.log('活动车型table', res);
    }
  }
};
</script>

<style lang="less"></style>
